<?php require VIEW_PATH."/header.php";?>
<body>
	<form method="post">
        <input type="hidden" name="cat_id" value="{{$field['cat_id']}}">
        <table class="hd-table hd-table-form hd-form">
            <thead>
                <tr>
                    <td colspan="2">修改栏目</td>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <th>父级</th>
                    <td>
                       <select name="pid">
                           <option value="0">===顶级栏目===</option>
                           {{foreach from="$cat" value="$v"}}
                           <option value="{{$v['cat_id']}}"
                           {{if value="$field['pid']==$v['cat_id']"}}
                           selected
                           {{endif}}

                           {{if value="$field['cat_id']==$v['cat_id']"}}
                           disabled
                           {{endif}}

                           {{if value="Data::isChild($cat,$v['cat_id'],$field['cat_id'],'cat_id')"}}
                           disabled
                           {{endif}}
                           >
                           {{$v['_cat_name']}}
                       </option>
                       {{endforeach}}
                   </select>
               </td>
           </tr>
           <tr>
            <th>栏目名称</th>
            <td>
                <input type="text" name="cat_name" value="{{$field['cat_name']}}" class="hd-w300">
            </td>
        </tr>
        <tr>
            <th>搜索类型</th>
            <td>
                <select name="type_id" id="">
                    <option value="0">选择</option>
                    {{foreach from="$goodsType" value="$v"}}
                    {{if value="$field['type_id']==$v['id']"}}
                    <option value="{{$v['id']}}" selected="">{{$v['type_name']}}</option>
                    {{else}}
                    <option value="{{$v['id']}}">{{$v['type_name']}}</option>
                    {{endif}}
                    {{endforeach}}
                </select>
            </td>
        </tr>
        <tr>
            <th>栏目关键词</th>
            <td>
                <input type="text" name="keyword" value="{{$field['keyword']}}" class="hd-w300">
            </td>
        </tr>
        <tr>
            <th>栏目描述</th>
            <td>
                <textarea name="dest" class="hd-w300 hd-h100">{{$field['dest']}}</textarea>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <button class="hd-btn hd-btn-primary">提交</button>
            </td>
        </tr>
    </tbody>
</table>
</form>
</body>
</html>